<?php
namespace app\index\controller;

class Article extends \think\Controller{
	public function remark(){
		return 'hello world'; 
	}

	public function index(){
		return $this -> fetch('index/index');
	}

	public function common(){
		echo \common\getName();
	}
	public function assign1(){
		$name = 'ywy';
		$name1 = array(
			'name'	=>	'yyy',
			'age'	=>	12,
			'sex'	=>	'female',
		);
		$name2 = array(
			array(
				'name'	=>	'yyy',
				'age'	=>	13,
				'sex'	=>	'female',
			),
			array(
				'name'	=>	'xxx',
				'age'	=>	12,
				'sex'	=>	'male',
			),
			array(
				'name'	=>	'www',
				'age'	=>	15,
				'sex'	=>	'female',
			),

		);
		$name3 = array(
			array(
				array(
					'name'	=>	'yyy1',
					'age'	=>	13,
					'sex'	=>	'female',
				),
				array(
					'name'	=>	'xxx',
					'age'	=>	12,
					'sex'	=>	'male',
				),
				array(
					'name'	=>	'www',
					'age'	=>	15,
					'sex'	=>	'female',
				),
			),
			array(
				array(
					'name'	=>	'yyy2',
					'age'	=>	13,
					'sex'	=>	'female',
				),
				array(
					'name'	=>	'xxx',
					'age'	=>	12,
					'sex'	=>	'male',
				),
				array(
					'name'	=>	'www',
					'age'	=>	15,
					'sex'	=>	'female',
				),
			),
			array(
				array(
					'name'	=>	'yyy3',
					'age'	=>	13,
					'sex'	=>	'female',
				),
				array(
					'name'	=>	'xxx',
					'age'	=>	12,
					'sex'	=>	'male',
				),
				array(
					'name'	=>	'www',
					'age'	=>	15,
					'sex'	=>	'female',
				),
			),
		);
		$this->assign('name',$name);
		$this->assign('people',$name1);
		$this->assign('peoples',$name2);
		$this->assign('peopless',$name3);
		return $this->fetch('index2');
	}

	public function condition1(){
		$arr = array(
			array(
				'name'	=>	'xp1',
				'age'	=> 	12,
				'sex'	=>	'male',
			),
			array(
				'name'	=>	'ywy1',
				'age'	=> 	11,
				'sex'	=>	'female',
			),
			array(
				'name'	=>	'yyy1',
				'age'	=> 	15,
				'sex'	=>	'female',
			),
		);
		$this->assign('people2',$arr);
		return $this->fetch('index3');
	}
}